package com.foreknow.demo10;

public class Test7 {
    public int add(int a, int b) throws CustomException {
        if (a < 0 || b < 0) {
            throw new CustomException();
        }
        return a + b;
    }

    public static void main(String[] args) {
        Test7 test7 = new Test7();
        try {
            int sum = test7.add(-1,-2);
            throw new CustomException();
        } catch (CustomException e) {
            e.printStackTrace();
        }
    }
}

